package com.web.base.wechat.util;

import com.blue.wechat.invoke.model.user.UserInfo;
import com.web.base.wechat.message.UserInfoResponse;

public class UserInfoConvertor
{
	private UserInfoConvertor()
	{
	}
	
	public static UserInfoResponse toResponse(UserInfo userInfo)
	{
		if (userInfo == null)
			return null;
		
		UserInfoResponse response = new UserInfoResponse();
		response.setSubscribe(userInfo.getSubscribe());
		response.setOpenid(userInfo.getOpenid());
		response.setNickname(userInfo.getNickname());
		response.setSex(userInfo.getSex());
		response.setCity(userInfo.getCity());
		response.setCountry(userInfo.getCountry());
		response.setProvince(userInfo.getProvince());
		response.setLanguage(userInfo.getLanguage());
		response.setHeadimgurl(userInfo.getHeadimgurl());
		response.setSubscribeTime(userInfo.getSubscribeTime());
		response.setRemark(userInfo.getRemark());
		response.setTagidList(userInfo.getTagidList());
		response.setUnionid(userInfo.getUnionid());
		return response;
	}
	
}
